{%extends file="wap_user/page/layout.tpl"%}
{%block name="sub-head-static"%}
    {%require name="wap_user:static/wallet/wallet.less"%}
{%/block%}

{%block name="body-container"%}
    <div class='page-title'>账户总览</div>
    <div class="page-wallet">
        <section class="asset-preview">
            <div class="block1">
                <div class="line1">
                    <div class="line-title">
                        <span>资金总额</span>
                    </div>
                    <div class="data">
                        {%$total = $data.term1.amount+$data.term3.amount+$data.term6.amount+$data.wallet.total+$data.demand.total%}
                        {%if $data.iphone6.credit%}
                            {%$total=$total+$data.iphone6.credit%}
                        {%/if%}
                        <div class="total">￥{%$total|format_amount%}</div>
                    </div>
                </div>
                <div class="line2">账户可用余额：￥{%$data.wallet.canwithdraw|format_amount%}</div>
            </div>

            {%*
            <div class="block2">
                <a class="btn">充值</a>
                <a class="btn">提现</a>
            </div>

            <div class="block21">
                <a href="/share/asset?sequence_id={%$data.sequence_id%}">晒收益抽提额券</a>
            </div
            *%}

            <ul class="block3">
                <li class="demand">
                    <span class="type">真融宝活期</span>
                    <span class="value">￥{%$data.demand.total|format_amount%}</span>
                </li>
                <li class="term">
                    <span class="type">真融宝定期</span>
                    <span class="value">￥{%($data.term1.amount+$data.term3.amount+$data.term6.amount)|format_amount%}</span>
                </li>
                {%if $data.iphone6.credit && $data.iphone6.credit>0%}
                <li class="iphone6">
                    <span class="type">果6宝</span>
                    <span class="value">￥{%$data.iphone6.credit|format_amount%}</span>
                </li>
                {%/if%}
                {%if $data.wallet.freeze>0%}
                    <li class="freeze">
                        <span class="type">冻结资金</span>
                        <span class="value">￥{%$data.wallet.freeze|format_amount%}</span>
                    </li>
                {%/if%}
            </ul>
        </section>
        <section class="asset asset-demand">
            <div class="line1">
                <div class="block-title">真融宝活期</div>
                <div class="profit">昨日收益：￥{%$data.demand.yesterday_return|format_amount%}</div>
                <i class="triangle-down"></i>
            </div>
            <div class="line2">
                <div>累计收益：￥{%$data.demand.total_return|format_amount%}</div>
                <div>持有份额：￥{%$data.demand.amount|format_amount%}</div>
            </div>
            <div class="line3">
                <a class="btn" href="/wap/buydemand">购买</a>
                <a class="btn" href="/wap/redeemdemand">赎回</a>
            </div>
        </section>
        <section class="asset asset-term">
            <div class="line1">
                <div class="block-title">真融宝定期</div>
                <div class="profit">预期收益：￥{%($data.term1.expect_return+$data.term3.expect_return+$data.term6.expect_return)|format_amount%}</div>
                <i class="triangle-down"></i>
            </div>
            <div class="line2">
                <div>持有份额：￥{%($data.term1.amount+$data.term3.amount+$data.term6.amount)|format_amount%}</div>
            </div>
            <div class="line3">
                <div>
                    <table>
                        <thead>
                        <tr>
                            <td>锁定期限</td>
                            <td>持有份额</td>
                            <td>预期收益</td>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>一个月</td>
                            <td>￥{%$data.term1.amount|format_amount%}</td>
                            <td>￥{%$data.term1.expect_return|format_amount%}</td>
                        </tr>
                        <tr>
                            <td>三个月</td>
                            <td>￥{%$data.term3.amount|format_amount%}</td>
                            <td>￥{%$data.term3.expect_return|format_amount%}</td>
                        </tr>
                        <tr>
                            <td>六个月</td>
                            <td>￥{%$data.term6.amount|format_amount%}</td>
                            <td>￥{%$data.term6.expect_return|format_amount%}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </section>
        {%if $data.iphone6.credit && $data.iphone6.credit>0%}
        <section class="asset asset-iphone">
            <div class="line1">
                <div class="block-title">果6宝</div>
                <div class="profit">预期收益：￥{%$data.iphone6.total_profit|format_amount%}</div>
                <i class="triangle-down"></i>
            </div>
            <div class="line2">
                <div>持有份额：￥{%$data.iphone6.credit|format_amount:4%}</div>
            </div>
        </section>
        {%/if%}
    </div>
{%/block%}